import matplotlib.pyplot as plt
import numpy.random as npr
from matplotlib.axes import Axes
from matplotlib.figure import Figure
import matplotlib
matplotlib.use(backend="TkAgg")

npr.seed(42)
fruit_weights = [
    # loc = mean, scale = standard deviation, size = number of samples
    npr.normal(loc=130, scale=10, size=100),
    npr.normal(loc=125, scale=20, size=100),
    npr.normal(loc=120, scale=30, size=100),
]

labels = ['peaches', 'oranges', 'tomatoes']
colors = ['peachpuff', 'orange', 'tomato']

fig:Figure
ax:Axes
fig, ax = plt.subplots()
ax.set_ylabel('fruit weight (g)')

bplot = ax.boxplot(x=fruit_weights,
           patch_artist=True, # fill with color
           tick_labels=labels) # will be used to label xticks

for patch,color in zip(bplot['boxes'], colors):
    patch.set_facecolor(color=color)


plt.show()